package Task1;

import java.util.Random;

public class Timo extends role implements Weapon , Armor{
    public Timo() {
    }

    public Timo(String name, int HP, int MP) {
        super(name, HP, MP);
    }
    final int attack =50;
    final int skill1=70;
    final int skill2=120;
    final int skill1Pay=10;
    final int skill2Pay=30;


    @Override
    public void armorAttack(role r) {
        System.out.println("提莫使用普通攻击对盖伦造成了"+(attack-10)+"点伤害");
        System.out.println("消耗0MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=(attack-10);if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }

    @Override
    public void armorSkill1(role r) {
        System.out.println("提莫使用致盲吹箭对盖伦造成了"+(skill1-10)+"点伤害");
        MP-=skill1Pay;
        System.out.println("消耗10MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=(skill1-10);if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }

    @Override
    public void armorSkill2(role r) {
        System.out.println("提莫使用种蘑菇对盖伦造成了"+(skill2-10)+"点伤害");
        MP-=skill2Pay;
        System.out.println("消耗30MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=(skill2-10);if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }

    @Override
    public void weaponAttack(role r) {
        System.out.println("提莫使用普通攻击对盖伦造成了"+(attack+10)+"点伤害");
        System.out.println("消耗0MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=(attack+10);if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }

    @Override
    public void weaponSkill1(role r) {
        System.out.println("提莫使用致盲吹箭对盖伦造成了"+(skill1+10)+"点伤害");
        MP-=skill1Pay;
        System.out.println("消耗10MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=(skill1+10);if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }

    @Override
    public void weaponSkill2(role r) {
        System.out.println("提莫使用种蘑菇对盖伦造成了"+(skill2+10)+"点伤害");
        MP-=skill2Pay;
        System.out.println("消耗30MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=(skill2+10);if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦提血量剩余"+HP);
        System.out.println("回合结束");
    }

    public void attack(role r) {
        System.out.println("提莫使用普通攻击对盖伦造成了"+attack+"点伤害");
        System.out.println("消耗0MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=attack;if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }


    public void skill1(role r) {
        System.out.println("提莫使用致盲吹箭对盖伦造成了"+skill1+"点伤害");
        MP-=skill1Pay;
        System.out.println("消耗10MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=skill1;if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }

    public void skill2(role r) {
        System.out.println("提莫使用种蘑菇对盖伦造成了"+skill2+"点伤害");
        MP-=skill2Pay;
        System.out.println("消耗30MP，剩余"+MP+"MP");
        int HP=r.getHP();
        HP-=skill2;if(HP<0)HP=0;
        r.setHP(HP);
        System.out.println("盖伦血量剩余"+HP);
        System.out.println("回合结束");
    }
    public int creat(){
        Random r = new Random();
        int n=r.nextInt(2)+1;
        if(n==1) System.out.println("提莫已购买暴风大剑");
        else System.out.println("提莫已购买锁子甲");
        return n;
    }
    public int creat2(){
        Random r= new Random();
        int n=r.nextInt(3)+1;
        return  n;
    }
}
